<%@ page contentType="text/html;charset=UTF-8"%>
<%@include file="module/common.jsp"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="cosmo云工厂">
<meta name="Keywords" content="cosmo,cosmo云工厂">
<title>cosmo云工厂</title>
<link href="${ctxStatic}/cloudfactory/css/basic.css" rel="stylesheet"
	type="text/css" />
<link href="${ctxStatic}/cloudfactory/css/main.css" rel="stylesheet"
	type="text/css" />
<link href="${ctxStatic}/cloudfactory/css/flex.css" rel="stylesheet"
	type="text/css" />
<link href="${ctxStatic}/cloudfactory/css/cloudFoundry.css"
	rel="stylesheet" type="text/css" />
<!–[if lt IE9]>
<script src="${ctxStatic}/cloudfactory/js/html5.js"></script>
<![endif]–>
</head>

<body>
	<div class="sys_warp">
		<!--header开始-->
		<jsp:include page="module/head.jsp" flush="true" />
		<!--header结束,banner开始-->
		<div class="banner child_banner title sys_wrap"></div>
		<div class="container child_container">
			<div class="sys_width">
				<ul class="pro__tab row tx-center bc-fff ps_r">
                <li class="cur_tab tabLi">
                    <a href="${ctx}/order/goCloudMarket?num=0&orderNo=${orderNo}">仓储</a>
                    <div class="subTab sys_width clearfix">
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff"  title="权限中心">权限中心</a></li>
                            <li><a class="tc-fff"  title="策略中心">策略中心</a></li>
                            <li><a class="tc-fff"  title="入厂后台任务">入厂后台任务</a></li>
                            <li><a class="tc-fff"  title="原材料预约管理">原材料预约管理</a></li>
                            <li><a class="tc-fff"  title="原材料出库管理成品入库">原材料出库管理成品入库</a></li>
                        </ul>
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff"  title="成品库内管理">成品库内管理</a></li>
                            <li><a class="tc-fff"  title="可视化展示">可视化展示</a></li>
                            <li><a class="tc-fff"  title="模板在线保存">模板在线保存</a></li>
                            <li><a class="tc-fff"  title="选择打印机厂家">选择打印机厂家</a></li>
                            <li><a class="tc-fff"  title="在线打印">在线打印</a></li>
                        </ul>
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff"  title="工作中心">工作中心</a></li>
                            <li><a class="tc-fff"  title="资源中心">资源中心</a></li>
                            <li><a class="tc-fff"  title="厂内后台作业">厂内后台作业</a></li>
                            <li><a class="tc-fff"  title="原材料入库管理">原材料入库管理</a></li>
                        </ul>
                    </div>
                </li>
                <li class="tabLi">
                    <a href="${ctx}/order/goCloudMarket?num=1&orderNo=${orderNo}">生产</a>
                    <div class="subTab sys_width row">
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff"  title="权限中心">权限中心</a></li>
                            <li><a class="tc-fff"  title="策略中心">策略中心</a></li>
                            <li><a class="tc-fff"  title="入厂后台任务">入厂后台任务</a></li>
                            <li><a class="tc-fff"  title="原材料预约管理">原材料预约管理</a></li>
                            <li><a class="tc-fff"  title="原材料出库管理成品入库">原材料出库管理成品入库</a></li>
                        </ul>
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff"  title="成品库内管理">成品库内管理</a></li>
                            <li><a class="tc-fff"  title="可视化展示">可视化展示</a></li>
                            <li><a class="tc-fff"  title="模板在线保存">模板在线保存</a></li>
                            <li><a class="tc-fff"  title="选择打印机厂家">选择打印机厂家</a></li>
                            <li><a class="tc-fff"  title="在线打印">在线打印</a></li>
                        </ul>
                    </div>
                </li>
                <li class="tabLi">
                    <a href="${ctx}/order/goCloudMarket?num=2&orderNo=${orderNo}">设备</a>
                    <div class="subTab sys_width row">
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff" title="暂无">暂无</a></li>
                        </ul>
                    </div>
                </li>
                <li class="tabLi">
                    <a href="${ctx}/order/goCloudMarket?num=3&orderNo=${orderNo}">质量</a>
                    <div class="subTab sys_width row">
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff" title="暂无">暂无</a></li>
                        </ul>
                    </div>
                </li>
                <li class="tabLi">
                    <a href="${ctx}/order/goCloudMarket?num=4&orderNo=${orderNo}">能源</a>
                    <div class="subTab sys_width row">
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff" title="暂无">暂无</a></li>
                        </ul>
                    </div>
                </li>
                <li class="tabLi">
                    <a href="${ctx}/order/goCloudMarket?num=5&orderNo=${orderNo}">成本</a>
                    <div class="subTab sys_width row">
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff" title="暂无">暂无</a></li>
                        </ul>
                    </div>
                </li>
                <li class="tabLi">
                    <a href="${ctx}/order/goCloudMarket?num=6&orderNo=${orderNo}">计划</a>
                    <div class="subTab sys_width row">
                        <ul class="subTabItem tx-left g_title1">
                            <li><a class="tc-fff" title="暂无">暂无</a></li>
                        </ul>
                    </div>
                </li>
            </ul>
				<p class="navText">
					<a onclick="history.go(-2)">云市场</a>&ensp;>&ensp;<a onclick="history.go(-1)">产品列表</a>&ensp;>&ensp;<a>产品详情</a>
				</p>
				<div class="row mb_30">
					<section class="pdet_box bc-fff ps_r sys_wrap">
						<div class="pd__top row">
							<div class="pd-top__left tx-center">
								<img class="mb_10" style="display: inline;"
									src="${ctxStatic}/cloudfactory/img/ic_qx_d.png" alt="">
								<h3 class="tc-blue mb_10">权限中心</h3>
								<p>${introduce }</p>
							</div>
							<div class="pd-top__right">
								<p class="mb_10">wms</p>
								<div class="row mb_10">
									<p>
										已安装量：<span>19929</span>
									</p>
									<div class="add_col ps_r">
										收藏 <i></i>
									</div>
								</div>
								<p class="mb_10">
									基础功能价格：<span>${one }元/月</span>&emsp;<span>${six }元/半年</span>&emsp;<span>${twelve }元/年</span>
								</p>
								<ul class="row pd__promise tc-fff">
									<li><i class="prom_ic1"></i>
										<div>
											<h4>交易期担保</h4>
											<p>交易金额担保平台</p>
										</div></li>
									<li><i class="prom_ic2"></i>
										<div>
											<h4>保证金机制</h4>
											<p>金额安全有保障</p>
										</div></li>
									<li><i class="prom_ic3"></i>
										<div>
											<h4>专业售后</h4>
											<p>7*24小时多渠道服务支持</p>
										</div></li>
									<li><i class="prom_ic4"></i>
										<div>
											<h4>优质产品审核</h4>
											<p>专业审核，技术保障</p>
										</div></li>
								</ul>
							</div>
						</div>
						<div class="pd__bot">
							<div class="func__basic mb_20">
								<div class="row func__title tc-blue mb_20">
									<i class="ic_basic"></i> 基础功能
								</div>
								<ul class="pro-main_cont bc-fff row">
									<c:forEach items="${basics}" var="function">
										<li>
											<h3 class="tc-blue mb_10">${function.functionName }</h3>
											<p>${function.abstracts }</p>
										</li>
									</c:forEach>
								</ul>
							</div>
							<div class="func__chose">
								<div class="row func__title tc-blue mb_20">
									<i class="ic_chose"></i> 选配功能
								</div>
								<ul class="pro-main_cont bc-fff row tx-center">
									<c:forEach items="${apolegamy}" var="function">
										<li>
											<h3 class="tc-blue mb_10">${function.functionName }</h3>
											<p>
												价格：<span>${function.money }/月</span>&emsp;&emsp;安装率：<span>10%</span>
											</p>
											<div class="add_btn tc-fff"
												onclick="andBuyCar('${function.id}')">加入清单</div>
										</li>
									</c:forEach>
								</ul>
							</div>
						</div>
					</section>
				</div>
				<!--全部功能应用-->
				<section class="pro__main pb_40">
					<div class="pro-main__title ps_r row">
						<i class="pro-main__ic"></i>
						<div class="bas__title">
							<p class="tc-yel">
								FEATURE <span class="tc-fff">LIST</span>
							</p>
							<h3 class="tc-fff">功能清单</h3>
						</div>
					</div>
					<div class="f__list">
						<div class="flist__top bc-fff mb_30">
							<div class="flist_title row mb_10">
								<h3 style="width: 20%; margin-right: 1%;" class="tc-blue">选择工厂</h3>
								<h3 style="width: %; margin-right: 1%;" class="tc-blue"></h3>
								<h3 style="width: 58%;" class="tc-blue">功能列表</h3>
							</div>
							<div class="flist_cont  row">
								<div class="fl_col fl__col_1">
									<c:choose>
										<c:when test="${factoryNum==0}">
              							<li><a  href="${ctx}/userCenter/goAndMyFactory" title="添加工厂">添加工厂</a></li>
              							
              							</c:when>
										<c:otherwise>
											<select name="choseFac" onChange="getChange()" id="choseFac">

												<c:forEach items="${factory}" var="f">
													<option value="${f.id }">${f.factoryName }</option>
												</c:forEach>
											</select>
										</c:otherwise>
									</c:choose>



								</div>
								<div class="fl_col fl__col_1">
									<input value="" id="factorycode">
								</div>
								<div class="fl_col fl__col_2 row">
									<div class="fitems_box row sys_wrap mb_10 tx-center">
										<div class="f__items1 f_bdr">基础功能</div>
										<ul class="f__items2 f_bdr">
											<c:forEach items="${basics}" var="function">
												<li>${function.functionName }</li>

											</c:forEach>
										</ul>
										<div class="f__items2 f_bdr">

											<select name="duration" id="duration">
												<option value="1">一个月</option>
												<option value="6">六个月</option>
												<option value="12">十二个月</option>
											</select>


										</div>
										<ul class="f__items1 f__delete">
											<li class="tc-fff">删除</li>
										</ul>
									</div>
									<div class="fitems_box row sys_wrap tx-center">
										<div class="f__items1 f_bdr">选配功能</div>
										<ul class="f__items2 f_bdr" id="chooseFunction">

										</ul>
										<ul class="f__items2 f_bdr" id="usetime">

										</ul>
										<ul class="f__items1 f__delete" id="deleBuyCar">
										</ul>
									</div>
								</div>
							</div>
						</div>
						<div class="fl__total row mb_30">
							<div class="tc-blue fl__price">
								总价：<span id="totalMoney"><b>¥&ensp;</b>0
									</ul>元</span>
							</div>
							<div class="add__cart bc-blue ps_r">
								<a onclick="insertBuyCar('${orderNo}')" class="tc-fff"><img
									src="${ctxStatic}/cloudfactory/img/ic_cart.png" alt="">
									加入购物车</a>

							</div>
						</div>
						<div class="ap__detail bc-fff">
							<div class="bas__title">
								<p class="tc-yel">
									APPLICATION <span class="tc-blue">DETAILS</span>
								</p>
								<h3 class="tc-blue">应用详情</h3>
							</div>
							<h3 class="tx-center apd_title">用户信息维护，用户授权，数据权限</h3>
							<div class="apd__cont">
								<p>WMS工厂信息维护，于CVS工厂匹配。</p>
								<p>用户信息维护，角色信息维护、分配。</p>
								<p>功能菜单管理</p>
								<p>等秘密码、交接密码</p>
								<p>数据权限类型维护。</p>
							</div>
						</div>
					</div>
				</section>
			</div>

		</div>
		<!--主体结束,footer开始-->
		<jsp:include page="module/foot.jsp" flush="true" />
		<!--footer结束-->
	</div>
</body>
<script type="text/javascript"
	src="${ctxStatic}/cloudfactory/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript"
	src="${ctxStatic}/cloudfactory/js/main.js"></script>
<script>
	var orderNo = "${orderNo }";
	var moneyss = 0;

	function insertBuyCar(orderNo) {
		var jichu = document.getElementById('duration').value;
		var factoryId = document.getElementById('choseFac').value;
		var num = "${num}";
		var flag = "${flag}";
		window.location.href = "${ctx}/order/insertBuyCar?orderNo=" + orderNo
				+ "&factoryId=" + factoryId + "&num=" + num + "&flag=" + flag
				+ "&jichu=" + jichu;

	}
	$(function() {
		indexInit();
	});

	function deleBuyCar(id, orderNo) {
		$.ajax({
			//几个参数需要注意一下
			type : "POST",//方法类型
			dataType : "json",//预期服务器返回的数据类型
			url : "${ctx}/order/deleBuyCar",//url
			data : {
				id : id,
				orderNo : orderNo
			},
			success : function(result) {
				changeli(result)
			}
		});
	}

	function getChangeUseTime(id) {
		var times = document.getElementById(id).value;
		$.ajax({
			//几个参数需要注意一下
			type : "POST",//方法类型
			dataType : "json",//预期服务器返回的数据类型
			url : "${ctx}/order/changeUseTime",//url
			data : {
				id : id,
				times : times
			},
			success : function(result) {
				changeli(result)
			}
		});
	}

	function andBuyCar(id) {
		$.ajax({
			//几个参数需要注意一下
			type : "POST",//方法类型
			dataType : "json",//预期服务器返回的数据类型
			url : "${ctx}/order/saveBuyCar",//url
			data : {
				id : id,
				orderNo : orderNo
			},
			success : function(result) {
				
				alert("添加成功");
				changeli(result)
			}
		});

	}
	function changeli(result) {
		var text1 = result.data;
		var dele = result.dele;
		var usetime = result.usetime;
		moneyss = result.money;
		//获取到Ul列表
		document.getElementById('totalMoney').innerText = moneyss;

		var usetimes = document.getElementById("usetime");
		for (var i = 0, num = usetimes.childNodes.length; i < num; i++) {
			usetimes.removeChild(usetimes.childNodes[i]);
		}
		$("#usetime li").remove();
		var ul = document.getElementById("chooseFunction");
		for (var i = 0, num = ul.childNodes.length; i < num; i++) {
			ul.removeChild(ul.childNodes[i]);
		}
		$("#chooseFunction li").remove();
		var deleBuyCar = document.getElementById("deleBuyCar");
		for (var i = 0, num = deleBuyCar.childNodes.length; i < num; i++) {
			deleBuyCar.removeChild(deleBuyCar.childNodes[i]);
		}
		$("#deleBuyCar li").remove();
		//创建元素Li
		debugger;
		var li = document.createElement("li");
		var li2 = document.createElement("li");
		var li3 = document.createElement("li");
		//向li中添加内容
		li.innerHTML = text1;
		li2.innerHTML = dele;
		li3.innerHTML = usetime;
		//向ul追加元素li
		ul.appendChild(li);
		deleBuyCar.appendChild(li2);
		usetimes.appendChild(li3);
	}
	function getChange() {

		// document.getElementById('factorycode').value = document.getElementById('choseFac').value;

	}
</script>
</html>